package com.xzc.spring5.factorybean;

import com.xzc.spring5.collectiontype.Course;
import org.hamcrest.Factory;
import org.springframework.beans.factory.FactoryBean;

import java.lang.annotation.Annotation;

/**
 * @author 徐州城
 * @version 1.0
 */
public class MyBean  implements FactoryBean<Course> {
    //定义返回bean类型，可以通过泛型 指定返回的类型
    @Override
    public Course getObject() throws Exception {
        Course course = new Course();
        course.setCname("abc");
        return course;
    }

    @Override
    public Class<?> getObjectType() {
        return null;
    }

    @Override
    public boolean isSingleton() {
        return false;
    }
}
